/**
 * @file   main.cpp
 * @author xingyifan <xingyifan@xingyifan-VirtualBox>
 * @date   Fri Oct 16 15:44:14 2020
 * 
 * @brief  main
 * 
 * 
 */

#include "class.h"
#include <chrono>
#include <ratio>

int main(int argc, char * argv[]) {
    int n;
    int index;
    double val;
    std::cin >> n;
    
    std::vector<DATA> A(n);
    for (int i=0;i<n;i++) {
	std::cin >> index;
	std::cin >> val;
	A[i].set(index, val);
    }

    typedef std::chrono::high_resolution_clock myclock;
    //start the timer
    myclock::time_point beginning = myclock::now();
    stable_quick_sort(A);
    //finish the timer
    myclock::duration d = myclock::now() - beginning;
    std::cout << "time: " << d.count() << std::endl;

    /*   for (int i=0;i<n;i++) {
	index = A[i].get(0);
	val = A[i].get(1);
	std::cout << index << " ";
	std::cout << val << std::endl;
    }
    */

    return 0;
}
